export let ajax = function(url,method,callback) {
    let x = new XMLHttpRequest()

    x.open(method, url)

    x.send()

    x.responseType = "json"

    x.onreadystatechange = function () {
        if (x.readyState === 4) {
            if (x.status >= 200 && x.status < 300) {
                let obj = x.response
                
                callback(obj)
            }
        }
    }
}

